package com.cyl.manager.pms.convert;

import com.cyl.h5.domain.dto.CategoryDTO;
import org.mapstruct.Mapper;
import com.cyl.manager.pms.domain.entity.ProductCategory;
import com.cyl.manager.pms.domain.vo.ProductCategoryVO;
import java.util.List;
import org.mapstruct.Mapping;
import com.cyl.manager.pms.req.ProductCategoryReq;
import com.cyl.manager.pms.resp.ProductCategoryResp;
import org.mapstruct.factory.Mappers;
/**
 * 商品分类  DO <=> DTO <=> VO / BO / Query
 *
 * @author zcc
 */
@Mapper(componentModel = "spring")
public interface ProductCategoryConvert  {

    ProductCategoryConvert INSTANCE = Mappers.getMapper(ProductCategoryConvert.class);

    List<ProductCategoryVO> dos2vos(List<ProductCategory> list);

    CategoryDTO do2dto(ProductCategory it);

    ProductCategory req2Entity(ProductCategoryReq req);
    
    @Mapping(target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    ProductCategoryResp entity2Resp(ProductCategory productCategory);
    
    List<ProductCategoryResp> entityList2RespList(List<ProductCategory> list);
}
